﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//
using Box.BL;
using Box.Entities;
using Microsoft.Practices.Unity;
using System.Web.ModelBinding;

namespace Box.Cliente.Logistica.Pago_Compras
{
    public partial class GestionarPagoCompras : System.Web.UI.Page
    {
        [Dependency]
        public ICompraBL CompraBL { get; set; }
        public IPagoCompraBL PagoCompraBL { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public IQueryable<Compra> FindSFCompraByTipoPago([Control("tbxCriterio")]string tipoPago)
        {
            return CompraBL.FindSearchingFromComprasByTipoPago(tipoPago).AsQueryable();
        }

        public IEnumerable<PagoCompra> FindSFPagoCompraById(Int32? id)
        {
            if (id == null)
            {
                return null;
            }

            //var idCompra = Request.QueryString["idCompra"];

            //if (idCompra==null)
            //{
            //    return null;
            //}
            //var ida = Int32.Parse(idCompra);

            return PagoCompraBL.FindSearchingFromCuotasPagoCompraById(id.Value).AsQueryable();
            
        }

    }
}